<?php
include('common_include.php');
include('validateSession.php');

$headOfficeInfo = $_POST["headOfficeTextArea"];
$showroomInfo = $_POST["showroomTextArea"];

$dao = new SQLitePersistence();

if ($headOfficeInfo != '' && $showroomInfo != '') {
	try {
		$dao->saveHeadOffice($headOfficeInfo);
		$dao->saveShowroom($showroomInfo);
		header("Location: successPage.php?msg=Head Office and Showroom Information save successfully");
	} catch (Exception $e) {
		header("Location: errorPage.php?error=Save Head Office and Showroom Failed.");
	}
} else {
	Logger::logInfo("Javascript Injection disabled");
	//disabled javascript injection
}

unset($dao);
?>